package com.link.base.base.questionnairesurvey.service;

import com.link.base.base.questionnairesurvey.model.Survey;
import com.link.core.basic.service.BasicService;

import java.util.Map;

/**
 * @author 刘鲁
 * @date 2018-07-04
 * @comments 问卷处理服务
 */
public interface SurveyService extends BasicService<Survey> {
    /**
     * 查询问卷详情
     *
     * @param survey
     * @return 问卷
     * @throws Exception
     */
    Survey queryOneDetails(Survey survey) throws Exception;

    /**
     * 保存问卷
     *
     * @param survey
     * @throws Exception
     */
    Survey SaveSurvey(Survey survey) throws Exception;

    /**
     * 提交问卷
     *
     * @param surver
     * @throws Exception
     */
    void submitSurvey(Survey surver) throws Exception;

    /**
     *
     *  保存问卷答案，不校验
     * @author NingLanhao
     * @date 2019-06-05 09:35
     * @param surver
     * @return void
     * @throws Exception
     */
    void saveSurveyAnswer(Survey surver) throws Exception;

    /**
     * 发布问卷
     *
     * @param surver
     * @throws Exception
     */
    void issueSurvey(Survey surver) throws Exception;

    /**
     * 生成问卷二维码
     * @param survey
     * @return Map
     * @throws Exception
     */
    public Map<String, Object> createMiniprogramCode(Survey survey) throws Exception;

    /**
     * 从模板中复制出一个回访问卷
     *
     * @author NingLanhao
     * @date 2019-06-17 19:56
     * @param survey 模板问卷
     * @return com.hand.business.base.questionnairesurvey.model.Survey
     * @throws Exception
     */
    Survey copyFromTemplate(Survey survey) throws Exception;

    /**
     * 模板复制到互动活动时替换跳题id
     * @param survey
     * @return
     * @throws Exception
     */
    Survey replaceNextTopicId(Survey survey) throws Exception;
}
